From a251b4e4c53d61f7e8627c01b463e9025dd25d52 Mon Sep 17 00:00:00 2001 From: justbur Date: Thu, 27 Aug 2015 08:43:55 -0400 Subject: [PATCH] Fix echo-keystrokes backup --- which-key.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/which-key.el b/which-key.el index 024d155301d..09ab2e886c4 100644 --- a/which-key.el +++ b/which-key.el @@ -341,6 +341,7 @@ used.") map) (if which-key-mode (progn + (setq which-key--echo-keystrokes-backup echo-keystrokes) (unless which-key--is-setup (which-key--setup)) (when which-key-use-C-h-for-paging (setq which-key--prefix-help-cmd-backup prefix-help-command @@ -382,16 +383,15 @@ set too high) and setup which-key buffer." (defun which-key--setup-echo-keystrokes () "Reduce `echo-keystrokes' if necessary (it will interfer if it's set too high)." - (when (and echo-keystrokes - (> (abs (- echo-keystrokes which-key-echo-keystrokes)) 0.000001)) - (setq which-key--echo-keystrokes-backup echo-keystrokes) - (if (> which-key-idle-delay which-key-echo-keystrokes) - (setq echo-keystrokes which-key-echo-keystrokes) - (setq which-key-echo-keystrokes - (min echo-keystrokes (/ (float which-key-idle-delay) 4)) - echo-keystrokes which-key-echo-keystrokes)) - (message "which-key: echo-keystrokes changed from %s to %s" - which-key--echo-keystrokes-backup echo-keystrokes))) + (let ((previous echo-keystrokes)) + (when (and echo-keystrokes + (> (abs (- echo-keystrokes which-key-echo-keystrokes)) 0.000001)) + (if (> which-key-idle-delay which-key-echo-keystrokes) + (setq echo-keystrokes which-key-echo-keystrokes) + (setq which-key-echo-keystrokes (/ (float which-key-idle-delay) 4) + echo-keystrokes which-key-echo-keystrokes)) + (message "which-key: echo-keystrokes changed from %s to %s" + previous echo-keystrokes)))) ;; Default configuration functions for use by users. Should be the "best" ;; configurations -- 2.30.2